import { isNullOrUndefined } from 'sks-plugin-el-erp/lib/core'
import { formatterFileSize, formatterTimeMdHm, formatterTimeYmd, formatterTimeYmdHm } from '@/utils/el-utils'

const myInputKey="chat-myInput"

//我要问的问题,在加载时候读取
export function loadChatMyInput(){
  let tmp=localStorage.getItem(myInputKey)
  if(isNullOrUndefined(tmp)) {
    return ''
  }
  return tmp
}

//缓存我要问的问题
export function saveChatMyInput(myInput){
  localStorage.setItem(myInputKey,myInput)
}

export function removeChatMyInput(){
  localStorage.removeItem(myInputKey)
}

/**
 * main中使用以下方式进行安装
 Vue.prototype.chatUtils={}
 require('./utils/chat').install(Vue.prototype.chatUtils)
 */
export function install(root){
  root.loadChatMyInput=loadChatMyInput
  root.saveChatMyInput=saveChatMyInput
  root.removeChatMyInput=removeChatMyInput
}
